<template>
    <div>
        <Form :model="formInline"  inline>
            <FormItem>
                <Input type="text" v-model="formInline.company" placeholder="单位">
                </Input>
            </FormItem>
            <FormItem>
                <Button type="primary" @click="search()">搜索</Button>
            </FormItem>
        </Form>
        <Table stripe :columns="columns1" :data="data1" border></Table>
        <Row type="flex" justify="end" class="pg">
            <Page :total="total" show-total style="margin-top: 20px;" @on-change="pageAction" />
        </Row>
    </div>
</template>

<script>
import { getSpvTransactionsGSList } from '@/api/user'
export default {

  data () {
    return {
      total: 0,
      formInline: {
        company: ''
      },
      columns1: [
        {
          title: '单位',
          key: 'company',
          align: 'center'
        },
        {
          title: '卡号/客户编号',
          key: 'card_num',
          align: 'center'
        },
        {
          title: '交易流水号',
          key: 'batch_number',
          align: 'center'
        },
        {
          title: '金额',
          key: 'money',
          align: 'center'
        },
        {
          title: '油量',
          key: 'fuel',
          align: 'center'
        },
        {
          title: '交易类型',
          key: 'transaction_type',
          align: 'center'
        },
        {
          title: '交易状态',
          key: 'transaction_status',
          align: 'center'
        },
        {
          title: '客户名称',
          key: 'name',
          align: 'center'
        },
        {
          title: '商品种类',
          key: 'type',
          align: 'center'
        },
        {
          title: '受理机构',
          key: 'acceptance_organization',
          align: 'center'
        },
        {
          title: '业务日期',
          key: 'business_time',
          align: 'center'
        },
        {
          title: '交易时间',
          key: 'transaction_time',
          align: 'center'
        },
        {
          title: '石油公司',
          key: 'oil_companies',
          align: 'center'
        }
      ],
      data1: [
        // {
        //   name: '现代农业研发服务中心',
        //   age: 50021.23,
        //   address: '2020-06-01',
        //   youliang: '35.54',
        //   youka: '9132555878223333',
        //   youhao: '10.1',
        //   didian: '辽宁销售沈阳分公司塔南加油站'
        // },
        // {
        //   name: '机关事务管理局',
        //   age: 24002,
        //   address: '2020-01-03',
        //   youliang: '37.27',
        //   youka: '9756565623323333',
        //   youhao: '11.39',
        //   didian: '辽宁销售沈阳分公司珠江加油站'
        // },
        // {
        //   name: '人民政府驻深圳办事处',
        //   age: 30356,
        //   address: '2020-05-21',
        //   youliang: '23.08',
        //   youka: '9798755123313277',
        //   youhao: '13.2',
        //   didian: '辽宁销售沈阳分公司小北加油站'
        // },
        // {
        //   name: '地方金融监督管理局',
        //   age: 26584,
        //   address: '2020-04-01',
        //   youliang: '66.33',
        //   youka: '9326567131456434',
        //   youhao: '15.1',
        //   didian: '辽宁销售沈阳分公司东海加油站'
        // }
      ]
    }
  },

  props: {

  },

  components: {

  },

  computed: {

  },

  methods: {
    async init (data) {
      getSpvTransactionsGSList(data).then(ret => {
        this.data1 = ret.data.data.results
        this.total = ret.data.data.totalRecord
      })
    },
    search () {
      let data = {
        company: this.formInline.company
      }
      this.init(data)
      console.log(this.init(data))
    },
    pageAction (current) {
      getSpvTransactionsGSList({ pageNo: current, company: this.formInline.company }).then(ret => {
        this.data1 = ret.data.data.results
      })
    }
  },

  watch: {

  },

  mounted () {
    this.init()
  }

}
</script>

<style scoped>

</style>
